package org.martin.snsrs.index;

import org.martin.snsrs.beans.User;
import org.martin.snsrs.daos.UserDao;

import com.opensymphony.xwork2.ActionSupport;

public class test extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;
	
	private String descript;
	
	private UserDao userDao;
	
	private String username;
	
	private String nickname;
	
	private Integer userPermission;
	
	private String password;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Integer getUserPermission() {
		return userPermission;
	}

	public void setUserPermission(Integer userPermission) {
		this.userPermission = userPermission;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}
	
	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	

	public String execute()
	{
		if(userDao.login(username, password))
			descript = SUCCESS;
		else {
			descript = ERROR;
		}
		return SUCCESS;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}
